package com.baixun.gasadmin.controller;


import com.baixun.gascommon.utils.R;
import com.baixun.gassystem.service.SysFileService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

/**
 * minio存储桶文件上传接口处理类
 */
@RestController
@RequestMapping("/admin/file")
@Api(value = "腾讯云存储桶文件上传管理模块类")
public class FileController {

    @Autowired
    public SysFileService sysFileService;

    // 上传
    @PostMapping("/upload")
    @ApiOperation(value = "文件上传")
    public R upload(@RequestParam("file") MultipartFile multipartFile) throws Exception {
       return   sysFileService.upload(multipartFile);
    }


    // okhttp测试
    @GetMapping("/okhttp")
    @ApiOperation(value = "okhttp测试")
    public R okhttp() throws Exception {
        return   sysFileService.okhttp();
    }

}
